package com.android.youwenchuang.presenter;

import com.android.youwenchuang.App;
import com.android.youwenchuang.base.IPresenter;
import com.android.youwenchuang.bean.Goods;
import com.android.youwenchuang.bean.HomeGoodsBean;

import java.util.ArrayList;
import java.util.List;

public class HomePresenter implements IPresenter {

    public List<HomeGoodsBean> getGoodsList() {
        List<Goods> list = App.mApp.getDaoSession().getGoodsDao().loadAll();
        List<HomeGoodsBean> goodsBeans = new ArrayList<>();
        for (int i = 0; i < list.size(); i++) {
            goodsBeans.add(new HomeGoodsBean(list.get(i)));
        }
        return goodsBeans;
    }
}
